package pers.lc.testDataGenerator.data;

import pers.lc.testDataGenerator.utils.CollectionUtils;

import java.util.List;

/**
 * 生成数据属性
 */
public class ColumnInfo {
    private String columnName; // 字段名q
    private String columnType; // 字段类型
    private String columnValue; // 字段值
    private List<String> columnArray; // 数组值
    public ColumnInfo(){}
    public ColumnInfo(String columnName,String columnType,String columnValue){
        this.columnName = columnName;
        this.columnType =columnType;
        this.columnValue = columnValue;
    }
    public ColumnInfo(String columnName,String columnType,List<String>columnArray){
        this.columnName = columnName;
        this.columnType =columnType;
        this.columnArray = columnArray;
    }

    public String getColumnName() {
        return columnName;
    }

    public String getColumnType() {
        return columnType;
    }

    public String getColumnValue() {
        return columnValue;
    }

    public void setColumnValue(String columnValue) {
        this.columnValue = columnValue;
    }

    public void setColumnType(String columnType) {
        this.columnType = columnType;
    }

    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }

    public List<String> getColumnArray() {
        return columnArray;
    }

    public void setColumnArray(List<String> columnArray) {
        this.columnArray = columnArray;
    }

    @Override
    public String toString(){
        StringBuilder result = new StringBuilder("{columnName:"+this.columnName+",columnType:"+this.columnType+",columnValue:"+this.columnValue);
        if (CollectionUtils.isNotEmpty(columnArray)){
            result.append(",columnArray:[");
            columnArray.forEach(s->{
                result.append(s).append(",");
            });
            result.append("]");
        }
        result.append("}");
        return result.toString();
    }
}
